package com.zte.shopping.service;

import com.zte.shopping.entity.ProductType;
import com.zte.shopping.entity.User;
import com.zte.shopping.exception.LoginNameOrPasswordErrorException;
import com.zte.shopping.exception.RequestParameterException;
import com.zte.shopping.exception.UserExistException;

import javax.servlet.http.HttpSession;
import java.util.List;

public interface UserService {

    public  Boolean  findUserByLoginName(String loginName);


    User userLogin(String loginName, String password);

    List<User> userList(Integer pageIndex);

    int userListCount();

    List<User> searchUserByParmaList(Integer pageIndex, String userName, String loginName, String phone, String address, Integer isValid);

    int userListCountByParamList(String userName, String loginName, String phone, String address, Integer isValid);

    void modifyStatus(String id, String status) throws RequestParameterException;

    void modifyById(User user);

    /**
     * @Author zuti
     * @Description //TODO 会员登录
     * @Date 16:29 2020/6/30
     * @Param [loginName, password, code, session]
     * @return com.zte.shopping.entity.User
     **/
    User login(String loginName, String password, String code, HttpSession session) throws LoginNameOrPasswordErrorException;

    /**
     * @Author zuti
     * @Description //TODO 会员注册
     * @Date 16:36 2020/6/30
     * @Param [user]
     * @return void
     **/
    void regist(User user) throws UserExistException;

    /**
     * @Author zuti
     * @Description //TODO 会员退出
     * @Date 16:41 2020/6/30
     * @Param [session]
     * @return void
     **/
    void logout(HttpSession session);

    /**
     * @Author zuti
     * @Description //TODO 会员密码修改
     * @Date 9:37 2020/7/1
     * @Param [userId, newPassword]
     * @return void
     **/
    void modifyPassword(String userId, String newPassword);

    /**
     * @Author zuti
     * @Description //TODO 前台修改用户信息
     * @Date 9:50 2020/7/1
     * @Param [userId, phone, address]
     * @return void
     **/
    void modifyUser(String userId, String phone, String address);
}
